package com.rj.framework.biz.transformer;

import com.rj.framework.transformer.ValueTransformer;

public class PhoneFormatter implements ValueTransformer {
    @Override
    public Object transform(Object value) {
        if (value == null) return null;
        String phone = value.toString();
        return phone.replaceFirst("(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3");
    }
}